]> dgit.raspbian.org Git - gnome-shell.git/commit
timeLimitsManager: Don't adjust times for offset changes after resume
authorSebastian Keller <skeller@gnome.org>
Wed, 30 Apr 2025 11:13:41 +0000 (13:13 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 5 May 2025 17:47:49 +0000 (17:47 +0000)
commitde1be54007507dba6a5aeda727d680a69684f701
treec4d7ee130e5da845896b9138368d4d4fa5a701d2
parentcbac740da361f65a49c300ab965abd79a7b8fa11
timeLimitsManager: Don't adjust times for offset changes after resume

The non-continuous change in wall clock time after a suspend/resume
triggers timeChangeNotify which adjusts the stored time data according
to the difference in clock offsets. The monotonic clock however might
not have advanced during the suspend. Since the offsets are the
difference between the wall clock time and monotonic time, the
difference between the old and new offset will be the duration of the
sleep if there was no change in the monotonic clock. Adjusting the time
data by this will move the beginning of the inactive period from the
suspend forward in time to just before the resume, effectively removing
it. Since all previous times are adjusted as well, this will result in
time data as if the system had been running continuously, but was
started later than it actually was.

Fix this by not adjusting times on resume and just updating the current
offset to account for the monotonic clock not advancing during sleep.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8289
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3707>
js/misc/timeLimitsManager.js
tests/unit/timeLimitsManager.js